<template>
	<view class="mainPage profitdetails" :style="{'padding-top': `${$store.state.safeArea.top || 0}px`, 'padding-bottom': `${$store.state.safeArea.bottom || 0}px`}">
		<public-head :title="title"></public-head>
		<view class="content">
			<view class="list">
				<view class="term">订单编号</view>
				<view class="termcontent">{{profitlist.relation}}</view>
			</view>
			<view class="list">
				<view class="term">收益类型</view>
				<view class="termcontent">{{profitlist.title}}</view>
			</view>
			<view class="list" v-if="profitlist.operation!=2">
				<view class="term">订单时间</view>
				<view class="termcontent">{{profitlist.addtime}}</view>
			</view>
			<view class="list">
				<view class="term">支付金额</view>
				<view class="termcontent">{{amountmoney}}</view>
			</view>
			<view class="list">
				<view class="term">平台服务费</view>
				<view class="termcontent">-{{profitlist.service}}</view>
			</view>
			<view class="list" v-if="profitlist.operation==2">
				<view class="term">退款时间</view>
				<view class="termcontent">{{profitlist.addtime}}</view>
			</view>
			<view class="list">
				<view class="term">备注</view>
				<view class="termcontent" v-if="profitlist.operation==2">{{profitlist.note}}</view>
			</view>
			<view class="list" v-if="profitlist.operation==1">
				<view class="income">收入</view>
				<view class="amount">+{{profitlist.money}}</view>
			</view>
			<view class="list" v-if="profitlist.operation==2">
				<view class="income">退款金额</view>
				<view class="amount active">-{{profitlist.money}}</view>
			</view>
		</view>
	</view>
</template>
<script>
var that
import publicHead from "@/components/publicHead/publicHead.vue"
export default {
	components: {
		publicHead
	},
	data() {
		return {
			title: "详情",
			profitlist: '',
			id: '',
			amountmoney: ''//退款或收入金额
		}
	},
	onLoad(e) {
		that = this
		that.id = e.id
		that.list()
	},
	methods: {
		list() {
			that.$postAjax1('Doc_Cash_moneyInfo', {
				id: that.id
			}, function (data) {
				that.profitlist = data.data.data
				that.amountmoney = (Number(that.profitlist.money) + Number(that.profitlist.service)).toFixed(2)
				console.log('列表', that.profitlist, that.amountmoney)
			})
		}
	},
}
</script>
 
<style  scoped lang="scss">
.profitdetails {
	padding: 24rpx 32rpx;
	background-color: #f4f4f4;
	min-height: 100vh;
	.content {
		box-shadow: 2rpx 2rpx 2rpx 0px rgba(0, 0, 0, 0.18);
		border-radius: 16rpx;
		background: #ffffff;
		padding: 32rpx;
		.list {
			font-size: 28rpx;
			padding: 12rpx 0;
			display: flex;
			justify-content: space-between;
			.term {
				color: #909090;
			}
			.termcontent {
				color: #323232;
			}
			.income {
				font-size: 32rpx;
				font-weight: 500;
				color: #323232;
				margin-top: 24rpx;
			}
			.amount {
				font-size: 32rpx;
				font-weight: 500;
				color: #f55050;
				margin-top: 24rpx;
			}
			.active {
				color: #ffbe7d;
			}
		}
	}
}
</style>
